﻿using System;
using System.Collections.Generic;
using System.Text;
using Core.Exceptions;
using Core.Model.Data;

namespace Core.Parser.ASN1Parser.Nodes
{
    internal abstract class ASN1Node
    {
        internal ASN1Node()
        {
        }

        protected void Failure(string p)
        {
            throw new OpenMhegException(p);
        }

        internal bool BoolValue
        {
            get
            {
                return ((BoolNode) this).Value;
            }
        }

        internal int IntValue
        {
            get
            {
                return ((IntNode)this).Value;
            }
        }

        internal string StringValue
        {
            get
            {
                return ((OctetStringNode)this).Value;
            }
        }

        internal int EnumValue
        {
            get
            {
                return ((EnumNode)this).Value;
            }
        }

    }
}
